/*
Project: bai tap C-case-study nhom 4 C0707L (Dung, Phung, Giang)
Filename: menu.c
Description: Cac menu chinh cua chuong trinh
Author: Bui Kim Dung
Created Date: 26/10/2007
Modified Date:
*/
#include <stdio.h>
#include <conio.h>

main_menu()
{
       int key;
       do
       {              
          printf("\n\t\tMAIN MENU\n");   
          printf("\t----------------------------------------------\n");  
          printf("\t1. Class Information\n");    
          printf("\t2. Student Information\n");    
          printf("\t3. Mark Information\n");    
          printf("\t4. Exit\n");
          printf("\t----------------------------------------------\n");
          printf("\tEnter your choice: ");                   
          scanf("%d",&key);
          switch(key)
          {
             case 1: 
                  class_menu();
                  break;           
             case 2: 
                  student_menu();
                  break;
             case 3: 
                  mark_menu();
                  break;
             case 4: 
                  exit(0);
                  break;
             default: 
                  printf("Please check the menu again!");    
                  break;
          }
       }
       while(key!=4);     
}

class_menu()
{
       int key;
       do
       {
             
          printf("\n\tClass Information\n"); 
          printf("\t----------------------------------------------\n");    
          printf("\t1. Add New Class\n");    
          printf("\t2. Edit Class Information\n");    
          printf("\t3. Delete Class Information\n");    
          printf("\t4. Class List\n");
          printf("\t5. Back to Main Menu\n");
          printf("\t6. Exit\n");
          printf("\t----------------------------------------------\n"); 
          printf("\tSelect the option(1-6): "); 
                 
          scanf("%d",&key);
          switch(key)
          {
             case 1: 
                  //class_new();
                  break;           
             case 2: 
                  //class_edit();
                  break;
             case 3: 
                  //class_delete();
                  break;
             case 4: 
                  //class_list();
                  break;
             case 5: 
                  main_menu();
                  break;
             case 6: 
                  exit(0);
                  break;
             default: 
                  printf("Please check the menu again!");    
                  break;
          }
       }
       while(key!=6);                         
}
student_menu()
{
       int key;
       do
       {
              
          printf("\n\tStudent Information\n");  
          printf("\t----------------------------------------------\n");   
          printf("\t1. Add New Student\n");    
          printf("\t2. Edit Student Information\n");    
          printf("\t3. Delete Student Information\n");    
          printf("\t4. Student List\n");
          printf("\t5. Find Student\n");
          printf("\t6. Back to Main Menu\n");
          printf("\t7. Exit\n");
          printf("\t----------------------------------------------\n");
          printf("\tSelect the option(1-7): "); 
                  
          scanf("%d",&key);
          switch(key)
          {
             case 1: 
                  //student_new();
                  break;           
             case 2: 
                  //student_edit();
                  break;
             case 3: 
                  //student_delete();
                  break;
             case 4: 
                  //student_list();
                  break;
             case 5: 
                  //student_find();
                  break;  
             case 6: 
                  main_menu();
                  break;
             case 7: 
                  exit(0);
                  break;
             default: 
                  printf("Please check the menu again!");    
                  break;
          }
       }
       while(key!=7);                         
}

mark_menu()
{
       int key;
       do
       {
                      
          printf("\n\tMark Information\n");
          printf("\t----------------------------------------------\n");     
          printf("\t1. Add Student's Mark\n");    
          printf("\t2. Edit Student's Mark\n");    
          printf("\t3. Class's Marks by Subject\n");    
          printf("\t4. Student's Average Mark\n");
          printf("\t5. Back to Main Menu\n");
          printf("\t6. Exit\n");
          printf("\t----------------------------------------------\n");
          printf("\tSelect the option(1-6): ");                   
          scanf("%d",&key);
          switch(key)
          {
             case 1: 
                  //mark_new();
                  break;           
             case 2: 
                  //mark_edit();
                  break;
             case 3: 
                  //mark_classBySubject();
                  break;
             case 4: 
                  //mark_studentAverage();
                  break;
             case 5: 
                  main_menu();
                  break;
             case 6: 
                  exit(0);
                  break;
             default: 
                  printf("Please check the menu again!");    
                  break;
          }
       }
       while(key!=6);                         
}

main()
{      
      printf("\n\t\tC CASE STUDY\n");
      printf("\n\tBatch C0707L \n");
      printf("\tFaculty: Bui Dinh Ngoc \n");
      printf("\tGroup 4 \n");
      printf("\tMembers:\n");
      printf("\t\tBui Kim Dung\n");
      printf("\t\tNgo Van Giang\n");
      printf("\t\tNguyen Dinh Phung\n");
      printf("\t----------------------------------------------\n");
      printf("\n\n\tHE THONG QUAN LY DIEM CHO SINH VIEN APTECH\n");
      main_menu();
      getch();      
}

